/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package com.xiashitech.agent.instrumentation.okhttp.common;

import io.opentelemetry.javaagent.shaded.io.opentelemetry.context.propagation.TextMapGetter;
import okhttp3.Response;

public enum ResponseHeaderGetter implements TextMapGetter<Response> {
  INSTANCE;

  @Override
  public Iterable<String> keys(Response carrier) {
    return carrier.headers().names();
  }

  @Override
  public String get(Response carrier, String key) {
    return carrier.header(key);
  }
}
